﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using SedCup.Code.Model;

namespace SedCup.Code.View.Components
{
    public partial class FieldHQ : Field
    {
        private Headquarter localHQ;
        /// <summary>
        /// Az ezen a mezőn álló főhadiszállás
        /// </summary>
        public Headquarter LocalHQ
        {
            get { return localHQ; }
            set { localHQ = value; this.UpdateHQ(); }
        }


        /// <summary>
        /// 
        /// </summary>
        /// <param name="id"></param>
        /// <param name="hq"></param>
        public FieldHQ(int id, Headquarter hq) : base(id)
        {
            InitializeComponent();

            this.BackColor = Settings.GUI_BACKCOLOR_FIELD;

            this.LocalHQ = hq;
        }

        /// <summary>
        /// 
        /// </summary>
        private void UpdateHQ()
        {
            if (this.LocalHQ.owner == "me")
                this.BackColor = Settings.GUI_BACKCOLOR_LOCALTEAM;
            else
                this.BackColor = Settings.GUI_BACKCOLOR_ENEMYTEAM;
        }
    }
}
